<template>
  <div class="home">
    <img class="home-img" :src="img"/>
    <div class="learn-space" @click="learnSpace"></div>
    <div class="expand-course" @click="expandCourse"></div>
    <div class="num-book" @click="numBook"></div>
    <div class="course-hit" @click="courseHit"></div>
    <div class="logo" @click="back"></div>
  </div>
</template>

<script>
  export default {
    name: "home",
    data(){
      return{
        img:require("../assets/img/xx.jpg")
      }
    },
    methods: {
      learnSpace(){
        window.location.href="https://cas2.edu.sh.cn/CAS/login?service=http%3A%2F%2Fyunjy.shec.edu.cn%2Fmanage%2Faccount%2Flink%2Fshanghai%3Facb%3DaHR0cHM6Ly95dW5qeS5zaGVjLmVkdS5jbi9pbmRleC5waHA%2Fcj1zYWZlTG9naW4vdW5pb24mYmFja3VybD1odHRwczovL3l1bmp5LnNoZWMuZWR1LmNuL3NwYWNlL2luZGV4LnBocD9yPWNlbnRlci9wZXJzb24vaW5kZXg%3D%26afn%3D0";
      },
      expandCourse(){
        this.$router.push('expandCourse');
      },
      numBook(){
        window.location.href="http://www.sh-genius.cn/";
      },
      courseHit(){
        this.$router.push('courseVideo');
      },
      back(){
        window.location.href="https://smile.shec.edu.cn/";
      }
    },
    created() {
      // let param = this.$route.query.username;
      // localStorage.setItem("username",param);
      // if (param.indexOf("老师") != -1){
      //   this.img = require("../assets/img/teacher.jpg")
      // }
      // if (param.indexOf("张可乐") != -1){
      //   this.img = require("../assets/img/zhangkele.png")
      // }
      // if (param.indexOf("张浩权") != -1){
      //   this.img = require("../assets/img/zhanghaoquan.jpg")
      // }
      // if (param.indexOf("杨歆瑶") != -1){
      //   this.img = require("../assets/img/yang.jpg")
      // }
    }
  }
</script>

<style lang="scss" scoped>
.home{
  width: 100%;
  height: 100%;
  position:relative;
  .home-img{
    width: 100%;
    height: auto;
  }
  .learn-space{
    position:absolute;
    top:61.5%;
    left:23%;
    width: 6.4%;
    height: 3.9%;
    opacity: 0.5;
    cursor:pointer;
    z-index:999;
  }
  .expand-course{
    position:absolute;
    top:61.5%;
    left:30%;
    width: 7%;
    height: 3.9%;
    opacity: 0.5;
    cursor:pointer;
    z-index:999;
  }
  .num-book{
    position:absolute;
    top:61.5%;
    left:37.5%;
    width: 7%;
    height: 3.9%;
    opacity: 0.5;
    cursor:pointer;
    z-index:999;
  }
  .course-hit{
    position:absolute;
    top:16.5%;
    left:52%;
    width: 26.2%;
    height: 58%;
    opacity: 0.5;
    cursor:pointer;
    z-index:999;
  }
  .logo{
    position:absolute;
    top:2%;
    left:16%;
    width: 22%;
    height: 3.5%;
    opacity: 0.5;
    cursor:pointer;
    z-index:999;
  }
}
</style>